function LD=mydet(x);
%function LD=mydet(x); 
%Computes Log of the determinant of matrix x 
%Use to avoid numerical problems when the determinant may be 
% very close to zero 
% AJ 10/26/03 
% Tested
[ss,vv,dd]=svd(x); 
LD = sum ( log(diag(vv) ) ); 
